﻿using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace rpt
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            ReportDocument reportDocument1 = new ReportDocument();
            //reportDocument1.Load(Application.StartupPath + "\\BlindBarCodeYF.rpt");
            reportDocument1.Load(Application.StartupPath + "\\RptTest.rpt");
            reportDocument1.PrintOptions.PrinterName = "Microsoft Print to PDF";//CS103
            //reportDocument1.SetDatabaseLogon("jesse.huang", "jesse76", "192.168.150.253", "ContainerInfo");
            reportDocument1.SetParameterValue("wo", "305102400559");
            //reportDocument1.SetParameterValue("CID", "YPat-HE1");
            //reportDocument1.SetParameterValue("@Mo", "1220009409-1/2");
            //reportDocument1.SetParameterValue("@ItemNo1", "001/01$N00157958168");
            //reportDocument1.SetParameterValue("@ClassId", "YPat");
            //reportDocument1.SetParameterValue("@PrintAirPanel", 0);
            //reportDocument1.SetParameterValue("@FCPaperFlag", "");

            crystalReportViewer1.ReportSource = reportDocument1;
            //reportDocument1.ExportToDisk(ExportFormatType.PortableDocFormat, Application.StartupPath+"\\ex.pdf");
            //reportDocument1.PrintOptions.PaperSize = 
            //reportDocument1.PrintToPrinter(0, false, 0, 0);
        }
    }
}
